/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: Pegasus  Date: 2018/11/21 Time: 10:06
 *
 * 个人中心
 */

import React, {Component} from 'react';
import {
    SafeAreaView, ScrollView, Text, TouchableOpacity, View,Switch
} from 'react-native';
import {connect} from 'react-redux';
import {styles} from './NewMessageSettingsScreen.Style';

class NewMessageSettingsScreen extends Component {

    static navigationOptions = ({navigation}) => ({
        headerTitle: `新消息提醒`,
    });

    // 构造
    constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            voice:true,
            shock:false,
            exchangeRooms:false,
            checkIn:false,
            checkOut:false,
            noDispatched:false,
        };
    }

    render() {
        return (
            <SafeAreaView style={styles.body}>
                <ScrollView style={styles.body}>
                    <View style={styles.formFirst}>
                        <View style={styles.formUpper}>
                            <View style={styles.leftBox}>
                                <Text style={styles.leftBoxText}>
                                    声音
                                </Text>
                            </View>
                            <View style={styles.rightBox}>
                                <Switch
                                    onValueChange={(value) => this.setState({voice: value})}
                                    style={{ transform: [{ scaleX: 1.3 }, { scaleY: 1.3 }] }}
                                    value={this.state.voice}
                                />
                            </View>
                        </View>
                        <View style={styles.formMiddle}>
                            <View style={styles.leftBox}>
                                <Text style={styles.leftBoxText}>
                                    震动
                                </Text>
                            </View>
                            <View style={styles.rightBox}>
                                <Switch
                                    onValueChange={(value) => this.setState({shock: value})}
                                    style={{ transform: [{ scaleX: 1.3 }, { scaleY: 1.3 }] }}
                                    value={this.state.shock} />
                            </View>
                        </View>
                        <View style={styles.formMiddle}>
                            <View style={styles.leftBox}>
                                <Text style={styles.leftBoxText}>
                                    催服务，客人换房提醒
                                </Text>
                            </View>
                            <View style={styles.rightBox}>
                                <Switch
                                    onValueChange={(value) => this.setState({exchangeRooms: value})}
                                    style={{ transform: [{ scaleX: 1.3 }, { scaleY: 1.3 }] }}
                                    value={this.state.exchangeRooms} />
                            </View>
                        </View>
                        <View style={styles.formMiddle}>
                            <View style={styles.leftBox}>
                                <Text style={styles.leftBoxText}>
                                    新客人入住提醒
                                </Text>
                            </View>
                            <View style={styles.rightBox}>
                                <Switch
                                    onValueChange={(value) => this.setState({checkIn: value})}
                                    style={{ transform: [{ scaleX: 1.3 }, { scaleY: 1.3 }] }}
                                    value={this.state.checkIn} />
                            </View>
                        </View>
                        <View style={styles.formMiddle}>
                            <View style={styles.leftBox}>
                                <Text style={styles.leftBoxText}>
                                    今日退未清洁的提醒
                                </Text>
                            </View>
                            <View style={styles.rightBox}>
                                <Switch
                                    onValueChange={(value) => this.setState({checkOut: value})}
                                    style={{ transform: [{ scaleX: 1.3 }, { scaleY: 1.3 }] }}
                                    value={this.state.checkOut} />
                            </View>
                        </View>
                        <View style={styles.formLower}>
                            <View style={styles.leftBox}>
                                <Text style={styles.leftBoxText}>
                                    维修单未派工单提醒
                                </Text>
                            </View>
                            <View style={styles.rightBox}>
                                <Switch
                                    onValueChange={(value) => this.setState({noDispatched: value})}
                                    style={{ transform: [{ scaleX: 1.3 }, { scaleY: 1.3 }] }}
                                    value={this.state.noDispatched} />
                            </View>
                        </View>
                    </View>
                </ScrollView>
            </SafeAreaView>
        )
    }
}

const props = state => {
    return {}
};

export default NewMessageSettingsScreen = connect(props)(NewMessageSettingsScreen);